package com.mapapp.flutter_mapapp.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.TextView;

import com.mapapp.flutter_mapapp.R;

import razerdp.basepopup.BasePopupWindow;

public class MapNoDateDialog extends Dialog {
    private CardView cvOk;
    private Context mContext;

    public MapNoDateDialog(Context context) {
        super(context, R.style.pickPhotoDialog);
        mContext = context;
        setCancelable(false);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_map_no_date);
        cvOk = findViewById(R.id.cv_map_no_date);
        init();
    }

    private void init() {
        cvOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onClick();
                }
                dismiss();
            }
        });

    }

    public interface OnItemClickListener {
        void onClick();
    }

    private OnItemClickListener listener;

    public void setListener(OnItemClickListener listener) {
        this.listener = listener;
    }
}
